home *** CD-ROM | disk | FTP | other *** search
- %OP%VS4.13 (28-Apr-92), Gerald L Fitton, R4000 5966 9904 9938
- %OP%TNN
- %OP%WRN
- %OP%DP0
- %OP%IRN
- %OP%PL0
- %OP%HM0
- %OP%FM0
- %OP%BM0
- %OP%LM4
- %OP%PT1
- %OP%PDPipeLine
- %OP%WC2,1242,44,628,0,1,0,6
- %OP%NDgrade_awarded,B10
- %OP%NDcomment_01,B32
- %OP%NDcomment_02,B53
- %OP%NDcode_table,C67C74
- %OP%NDcomment_table,D67D74
- %OP%NDinvalid_message,B54
- %OP%FR0,2
- %CO:A,38,72%Comments and Commands
-
-
-
-
-
- %V%%L%function("grade","marks:number")
-
- Declare all local variables as names
- %V%%L%set_name("grade_awarded",B10)
-
- Test whether the data is valid (ie within range)
- If the data is invalid then exit from the custom function
- returning an appropriate 'error message' to say why
- %V%%L%if(@marks>100,result("Over 100%PC%?"),)
- %V%%L%if(@marks< 0,result("Below 0%PC%?"),)
-
- Find the grade from the mark using - if(condition,true,false) -
- Note that if the condition is 'false' then nothing is executed
- %V%%L%if(@marks<=100,set_value(grade_awarded,"Distinction -"),)
- %V%%L%if(@marks< 85,set_value(grade_awarded,"Merit -"),)
- %V%%L%if(@marks< 65,set_value(grade_awarded,"Pass -"),)
- %V%%L%if(@marks< 40,set_value(grade_awarded,"Fail -"),)
-
- %V%%L%result(grade_awarded)
-
- ------------------------------------------------------------------------
-
- %V%%L%function("first_comment","code:text")
-
- Declare all local variables as names
- %V%%L%set_name("comment_01",B32)
-
- Set the local variable to a default value using set_value(name,value)
- %V%%L%set_value(comment_01,"Only codes 0 to 6 are valid")
-
- %V%%L%if(@code="6",set_value(comment_01,"and perfect attendance"),)
- %V%%L%if(@code="5",set_value(comment_01,"and good attendance"),)
- %V%%L%if(@code="4",set_value(comment_01,"and poor attendance"),)
- %V%%L%if(@code="3",set_value(comment_01,"and bad attendance"),)
- %V%%L%if(@code="2",set_value(comment_01,"and rarely attends"),)
- %V%%L%if(@code="1",set_value(comment_01,"and very rarely attends"),)
- %V%%L%if(@code="0",set_value(comment_01,"and never attends"),)
-
- %V%%L%result(comment_01)
-
- ------------------------------------------------------------------------
- %V%%L%function("second_comment","code:text")
-
- Declare all data and local variables as names
- %V%%L%set_name("code_table", C67C74)
- %V%%L%set_name("comment_table",D67D74)
- %V%%L%set_name("comment_02", B53)
- %V%%L%set_name("invalid_message",B54)
-
- Use a lookup table to find the comment corresponding to the code
- %V%%L%set_value(comment_02,lookup(@code,code_table,comment_table))
-
- Initialise the 'error message' variable with a default value
- %V%%L%set_value(invalid_message,"Use codes 0 to 6 only")
-
- Use it to 'improve' the error message
- %V%%L%if(comment_02="Invalid",set_value(comment_02,invalid_message),)
-
- %V%%L%result(comment_02)
-
- Fixed data tables are placed in columns
- to the right and after the custom function
- This is so that rows may be added or deleted
- from the custom function without losing data
- or causing the tables to become 'ragged'
-
-
- Note: An 'invalid data' trap is part of a 'lookup' table
-
- ------------------------------------------------------------------------
- %CO:B,23,0%%R%Value
-
-
-
-
-
-
-
-
- %V%%R%%LC%"Pass -"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %V%%R%"and good attendance"
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %V%%R%"Good"
- %V%%R%"Use codes 0 to 6 only"
- %CO:C,2,0%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- %R%0
- %R%1
- %R%2
- %R%3
- %R%4
- %R%5
- %R%6
- ^#
- %CO:D,9,0%
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Never
- Very rare
- Rare
- Bad
- Poor
- Good
- Perfect
- Invalid
-